﻿// Dynamic tree editor - tree-like data structures editor for .NET/Mono.
// Copyright (C) 2006  Vladimir Sibirov
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;

namespace TreeEditor
{
	/// <summary>
	/// Application About dialog form.
	/// </summary>
	public class AboutDialog : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label labelProduct;
		private System.Windows.Forms.TextBox textLicense;
		private System.Windows.Forms.Button buttonOK;
		private System.Windows.Forms.Label labelLicense;
		private string culture;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		/// <summary>
		/// Form constructor.
		/// </summary>
		public AboutDialog()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Used for internationalization.
		/// </summary>
		internal string Culture
		{
			get
			{
				return culture;
			}
			set
			{
				culture = value;
			}
		}
		
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// 
		/// Метод, требуемый для поддержки Дизайнера.
		/// Не изменяйте его в редакторе кода.
		/// </summary>
		private void InitializeComponent()
		{
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDialog));
			this.labelProduct = new System.Windows.Forms.Label();
			this.labelContacts = new System.Windows.Forms.Label();
			this.textLicense = new System.Windows.Forms.TextBox();
			this.buttonOK = new System.Windows.Forms.Button();
			this.labelLicense = new System.Windows.Forms.Label();
			this.labelAuthors = new System.Windows.Forms.Label();
			this.textAuthors = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// labelProduct
			// 
			this.labelProduct.AccessibleDescription = null;
			this.labelProduct.AccessibleName = null;
			this.labelProduct.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("labelProduct.Anchor")));
			this.labelProduct.AutoSize = ((bool)(resources.GetObject("labelProduct.AutoSize")));
			this.labelProduct.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("labelProduct.BackgroundImageLayout")));
			this.labelProduct.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("labelProduct.Dock")));
			this.labelProduct.Font = null;
			this.labelProduct.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelProduct.ImageAlign")));
			this.labelProduct.ImageIndex = ((int)(resources.GetObject("labelProduct.ImageIndex")));
			this.labelProduct.ImageKey = resources.GetString("labelProduct.ImageKey");
			this.labelProduct.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("labelProduct.ImeMode")));
			this.labelProduct.Location = ((System.Drawing.Point)(resources.GetObject("labelProduct.Location")));
			this.labelProduct.Name = "labelProduct";
			this.labelProduct.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("labelProduct.RightToLeft")));
			this.labelProduct.Size = ((System.Drawing.Size)(resources.GetObject("labelProduct.Size")));
			this.labelProduct.TabIndex = ((int)(resources.GetObject("labelProduct.TabIndex")));
			this.labelProduct.Text = resources.GetString("labelProduct.Text");
			this.labelProduct.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelProduct.TextAlign")));
			// 
			// labelContacts
			// 
			this.labelContacts.AccessibleDescription = null;
			this.labelContacts.AccessibleName = null;
			this.labelContacts.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("labelContacts.Anchor")));
			this.labelContacts.AutoSize = ((bool)(resources.GetObject("labelContacts.AutoSize")));
			this.labelContacts.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("labelContacts.BackgroundImageLayout")));
			this.labelContacts.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("labelContacts.Dock")));
			this.labelContacts.Font = null;
			this.labelContacts.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelContacts.ImageAlign")));
			this.labelContacts.ImageIndex = ((int)(resources.GetObject("labelContacts.ImageIndex")));
			this.labelContacts.ImageKey = resources.GetString("labelContacts.ImageKey");
			this.labelContacts.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("labelContacts.ImeMode")));
			this.labelContacts.Location = ((System.Drawing.Point)(resources.GetObject("labelContacts.Location")));
			this.labelContacts.Name = "labelContacts";
			this.labelContacts.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("labelContacts.RightToLeft")));
			this.labelContacts.Size = ((System.Drawing.Size)(resources.GetObject("labelContacts.Size")));
			this.labelContacts.TabIndex = ((int)(resources.GetObject("labelContacts.TabIndex")));
			this.labelContacts.Text = resources.GetString("labelContacts.Text");
			this.labelContacts.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelContacts.TextAlign")));
			// 
			// textLicense
			// 
			this.textLicense.AcceptsReturn = true;
			this.textLicense.AcceptsTab = true;
			this.textLicense.AccessibleDescription = null;
			this.textLicense.AccessibleName = null;
			this.textLicense.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("textLicense.Anchor")));
			this.textLicense.BackgroundImage = null;
			this.textLicense.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("textLicense.BackgroundImageLayout")));
			this.textLicense.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("textLicense.Dock")));
			this.textLicense.Font = null;
			this.textLicense.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("textLicense.ImeMode")));
			this.textLicense.Location = ((System.Drawing.Point)(resources.GetObject("textLicense.Location")));
			this.textLicense.MaxLength = ((int)(resources.GetObject("textLicense.MaxLength")));
			this.textLicense.Multiline = ((bool)(resources.GetObject("textLicense.Multiline")));
			this.textLicense.Name = "textLicense";
			this.textLicense.PasswordChar = ((char)(resources.GetObject("textLicense.PasswordChar")));
			this.textLicense.ReadOnly = true;
			this.textLicense.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("textLicense.RightToLeft")));
			this.textLicense.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("textLicense.ScrollBars")));
			this.textLicense.Size = ((System.Drawing.Size)(resources.GetObject("textLicense.Size")));
			this.textLicense.TabIndex = ((int)(resources.GetObject("textLicense.TabIndex")));
			this.textLicense.Text = resources.GetString("textLicense.Text");
			this.textLicense.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("textLicense.TextAlign")));
			this.textLicense.WordWrap = ((bool)(resources.GetObject("textLicense.WordWrap")));
			// 
			// buttonOK
			// 
			this.buttonOK.AccessibleDescription = null;
			this.buttonOK.AccessibleName = null;
			this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("buttonOK.Anchor")));
			this.buttonOK.AutoSize = ((bool)(resources.GetObject("buttonOK.AutoSize")));
			this.buttonOK.AutoSizeMode = ((System.Windows.Forms.AutoSizeMode)(resources.GetObject("buttonOK.AutoSizeMode")));
			this.buttonOK.BackgroundImage = null;
			this.buttonOK.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("buttonOK.BackgroundImageLayout")));
			this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.buttonOK.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("buttonOK.Dock")));
			this.buttonOK.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("buttonOK.FlatStyle")));
			this.buttonOK.Font = null;
			this.buttonOK.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("buttonOK.ImageAlign")));
			this.buttonOK.ImageIndex = ((int)(resources.GetObject("buttonOK.ImageIndex")));
			this.buttonOK.ImageKey = resources.GetString("buttonOK.ImageKey");
			this.buttonOK.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("buttonOK.ImeMode")));
			this.buttonOK.Location = ((System.Drawing.Point)(resources.GetObject("buttonOK.Location")));
			this.buttonOK.Name = "buttonOK";
			this.buttonOK.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("buttonOK.RightToLeft")));
			this.buttonOK.Size = ((System.Drawing.Size)(resources.GetObject("buttonOK.Size")));
			this.buttonOK.TabIndex = ((int)(resources.GetObject("buttonOK.TabIndex")));
			this.buttonOK.Text = resources.GetString("buttonOK.Text");
			this.buttonOK.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("buttonOK.TextAlign")));
			this.buttonOK.TextImageRelation = ((System.Windows.Forms.TextImageRelation)(resources.GetObject("buttonOK.TextImageRelation")));
			// 
			// labelLicense
			// 
			this.labelLicense.AccessibleDescription = null;
			this.labelLicense.AccessibleName = null;
			this.labelLicense.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("labelLicense.Anchor")));
			this.labelLicense.AutoSize = ((bool)(resources.GetObject("labelLicense.AutoSize")));
			this.labelLicense.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("labelLicense.BackgroundImageLayout")));
			this.labelLicense.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("labelLicense.Dock")));
			this.labelLicense.Font = null;
			this.labelLicense.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelLicense.ImageAlign")));
			this.labelLicense.ImageIndex = ((int)(resources.GetObject("labelLicense.ImageIndex")));
			this.labelLicense.ImageKey = resources.GetString("labelLicense.ImageKey");
			this.labelLicense.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("labelLicense.ImeMode")));
			this.labelLicense.Location = ((System.Drawing.Point)(resources.GetObject("labelLicense.Location")));
			this.labelLicense.Name = "labelLicense";
			this.labelLicense.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("labelLicense.RightToLeft")));
			this.labelLicense.Size = ((System.Drawing.Size)(resources.GetObject("labelLicense.Size")));
			this.labelLicense.TabIndex = ((int)(resources.GetObject("labelLicense.TabIndex")));
			this.labelLicense.Text = resources.GetString("labelLicense.Text");
			this.labelLicense.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelLicense.TextAlign")));
			// 
			// labelAuthors
			// 
			this.labelAuthors.AccessibleDescription = null;
			this.labelAuthors.AccessibleName = null;
			this.labelAuthors.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("labelAuthors.Anchor")));
			this.labelAuthors.AutoSize = ((bool)(resources.GetObject("labelAuthors.AutoSize")));
			this.labelAuthors.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("labelAuthors.BackgroundImageLayout")));
			this.labelAuthors.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("labelAuthors.Dock")));
			this.labelAuthors.Font = null;
			this.labelAuthors.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelAuthors.ImageAlign")));
			this.labelAuthors.ImageIndex = ((int)(resources.GetObject("labelAuthors.ImageIndex")));
			this.labelAuthors.ImageKey = resources.GetString("labelAuthors.ImageKey");
			this.labelAuthors.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("labelAuthors.ImeMode")));
			this.labelAuthors.Location = ((System.Drawing.Point)(resources.GetObject("labelAuthors.Location")));
			this.labelAuthors.Name = "labelAuthors";
			this.labelAuthors.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("labelAuthors.RightToLeft")));
			this.labelAuthors.Size = ((System.Drawing.Size)(resources.GetObject("labelAuthors.Size")));
			this.labelAuthors.TabIndex = ((int)(resources.GetObject("labelAuthors.TabIndex")));
			this.labelAuthors.Text = resources.GetString("labelAuthors.Text");
			this.labelAuthors.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("labelAuthors.TextAlign")));
			// 
			// textAuthors
			// 
			this.textAuthors.AccessibleDescription = null;
			this.textAuthors.AccessibleName = null;
			this.textAuthors.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("textAuthors.Anchor")));
			this.textAuthors.BackgroundImage = null;
			this.textAuthors.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("textAuthors.BackgroundImageLayout")));
			this.textAuthors.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("textAuthors.Dock")));
			this.textAuthors.Font = null;
			this.textAuthors.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("textAuthors.ImeMode")));
			this.textAuthors.Location = ((System.Drawing.Point)(resources.GetObject("textAuthors.Location")));
			this.textAuthors.MaxLength = ((int)(resources.GetObject("textAuthors.MaxLength")));
			this.textAuthors.Multiline = ((bool)(resources.GetObject("textAuthors.Multiline")));
			this.textAuthors.Name = "textAuthors";
			this.textAuthors.PasswordChar = ((char)(resources.GetObject("textAuthors.PasswordChar")));
			this.textAuthors.ReadOnly = true;
			this.textAuthors.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("textAuthors.RightToLeft")));
			this.textAuthors.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("textAuthors.ScrollBars")));
			this.textAuthors.Size = ((System.Drawing.Size)(resources.GetObject("textAuthors.Size")));
			this.textAuthors.TabIndex = ((int)(resources.GetObject("textAuthors.TabIndex")));
			this.textAuthors.Text = resources.GetString("textAuthors.Text");
			this.textAuthors.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("textAuthors.TextAlign")));
			this.textAuthors.WordWrap = ((bool)(resources.GetObject("textAuthors.WordWrap")));
			// 
			// AboutDialog
			// 
			this.AccessibleDescription = null;
			this.AccessibleName = null;
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoSize = ((bool)(resources.GetObject("$this.AutoSize")));
			this.AutoSizeMode = ((System.Windows.Forms.AutoSizeMode)(resources.GetObject("$this.AutoSizeMode")));
			this.BackgroundImage = null;
			this.BackgroundImageLayout = ((System.Windows.Forms.ImageLayout)(resources.GetObject("$this.BackgroundImageLayout")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.ControlBox = false;
			this.Controls.Add(this.textAuthors);
			this.Controls.Add(this.labelAuthors);
			this.Controls.Add(this.labelLicense);
			this.Controls.Add(this.buttonOK);
			this.Controls.Add(this.textLicense);
			this.Controls.Add(this.labelContacts);
			this.Controls.Add(this.labelProduct);
			this.Font = null;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Icon = null;
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximizeBox = false;
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimizeBox = false;
			this.Name = "AboutDialog";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.RightToLeftLayout = ((bool)(resources.GetObject("$this.RightToLeftLayout")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.Shown += new System.EventHandler(this.AboutDialogShown);
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		private System.Windows.Forms.TextBox textAuthors;
		private System.Windows.Forms.Label labelAuthors;
		private System.Windows.Forms.Label labelContacts;
		#endregion
		
		/// <summary>
		/// Loads the auxilliary data.
		/// </summary>
		/// <param name="sender">Sender object.</param>
		/// <param name="e">Event arguments.</param>
		void AboutDialogShown(object sender, System.EventArgs e)
		{
			string licenseFile = (culture == "ru") ? "License_ru.txt" : "License.txt";
			labelProduct.Text = Application.ProductName + " v." + Application.ProductVersion;
			StreamReader sr = new StreamReader(Application.StartupPath + "/" + licenseFile);
			textLicense.Text = sr.ReadToEnd();
			sr.Close();
		}
	}
}
